import Vue from 'vue'

// 初始化css base.css reset.css
import 'normalize.css/normalize.css'

// 导入elementui
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

// 导入全局的scss
import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

// 注册全局组件
import components from './components'
Vue.use(components)

// 设置全局自定义指令
import * as directives from '@/directives'
Object.keys(directives).forEach((k) => {
  Vue.directive(k, directives[k])
})

// 设置全局过滤器
import * as filters from '@/filters'
Object.keys(filters).forEach(k => {
  Vue.filter(k, filters[k])
})

// 注册全局打印
import Print from 'vue-print-nb'
Vue.use(Print)

import i18n from '@/lang'
// 配置ElementUI的中英切换逻辑
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)
// import './styles/element-variables.scss'
Vue.config.productionTip = false

new Vue({
  // el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
